package com.cpecc.manager.wuzi;

import com.cpecc.dao.wuzi.BaoFeiDao;
import com.cpecc.model.system.User;
import com.cpecc.model.wuzi.BaoFei;
import com.cpecc.model.wuzi.WuZi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class BaoFeiManager {

	@Autowired
	private BaoFeiDao baoFeiDao;
	
	public void save(BaoFei baoFei){
		baoFeiDao.save(baoFei);
	}
	
	public BaoFei get(String id){
		return baoFeiDao.get(id);
	}
	
	public boolean cover(BaoFei baoFei){
		return baoFeiDao.cover(baoFei);
	}
	
	public List<BaoFei> getMyBaoFei(User user){
		return baoFeiDao.getMyBaoFei(user);
	}
	
	public List<BaoFei> getBaoFeiList(int huanJie){
		return baoFeiDao.getBaoFeiList(huanJie);
	}

	/**
	 * 报废使用人确认列表
	 * @param user
	 * @return
	 */
	public List<BaoFei> getBfsysqrList(User user){
		return baoFeiDao.getBfsyrqrList(user);
	}

	public List<BaoFei> getBaoFeiList(int huanJie,User user){
		return baoFeiDao.getBaoFeiList(huanJie,user);
	}
	
	public List<BaoFei> getBaoFeiNeiGouList(int huanJie,User user){
		return baoFeiDao.getBaoFeiNeiGouList(huanJie,user);
	}
	
	public List<BaoFei> getBaoFeiBMList(User user){
		return baoFeiDao.getBaoFeiBMList(user);
	}
	
	public List<BaoFei> getAllBaoFeiKu(WuZi wuZi,String wuZiLBId){
		return baoFeiDao.getAllBaoFeiKu(wuZi, wuZiLBId);
	}
	
	public List<BaoFei> getAllByWuZi(WuZi wuZi){
		return baoFeiDao.getAllByWuZi(wuZi);				
	}
	
	public boolean hasWuZi(String wuZiId){
		return baoFeiDao.hasWuZi(wuZiId);
	}
	
	public boolean hasLiuCheng(User user){
		return baoFeiDao.hasLiuCheng(user);
	}
	
	public List<BaoFei> activeBaoFei(){
		return baoFeiDao.activeBaoFei();
	}

	public boolean delete(String id) {
		return baoFeiDao.delete(id);
	}
}
